import Vue from 'vue'
import VueRouter from 'vue-router'
//只有在路由界面中注册路由模块，才能在页面中使用<router-link>	和 <router-view>	
Vue.use(VueRouter)





//配置路径和映射规则
import Layout from '../views/Layout/index.vue'
import Home from '../views/home/index.vue'
import Play from '../views/play/index.vue'
import Search from '../views/search/index.vue'
const routes = [
	//初始页面重定向
	{path: '/' , redirect: '/layout'},
	
	//默认重定向到首页
	{path: '/layout' , component: Layout , redirect: '/layout/Home' ,
	
	
		//二级路由
	 children: [
		 //子路由内路径不需要加斜杠
		 //在路由配置中加入源信息 meta
		{path: 'Home' , component: Home , meta:{title: "首页"}},
		{path: 'Search' , component: Search , meta:{title: "搜索"}}
	]},
	
	{path: '/Play' , component: Play}

]






//new 一个路由实例 - 需配置映射规则
const router = new VueRouter({
	routes
})

export default router
